<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>属性绑定</title>
		<style>
			.redClass{
				color: aquamarine;
				width: 100px;
				height: 50px;
				border: brown;
				background-color: coral;
			}
		</style>
		
	</head>
	<body>
		<div id="app">
			<!-- 需求：将网址动态的获取
			 标签是：v-bind
			 -->
			 <a v-bind:href="url">百度</a>
			 <!-- 简化写法 -->
			 <a :href="url">百度</a>
			 <hr >
			 <!-- 类型的绑定 class属性一般用来修饰样式-->
			 <div :class="{redClass: flag}"> </div>
			 <button @click="flag= !flag">切换样式</button>
			 	
			
			 
		</div>
		
		<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
		<script type="text/javascript">
			
		const app=new Vue({
			
			el: '#app',
			data: {
				url:'http://baidu.com',
				flag:true
				
			},
			methods: {
				
			}
			
		})	
			
		</script>
		
	</body>
</html>
